package com.fengyunhe.manager.dao.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * 功能：
 * 作者： yangyan
 * 时间： 2014/9/5 .
 */
@Entity
@Table(name = "admin_user")
public class AdminUserEntity {
    private Integer userId;
    private Integer userType;
    private String email;
    private String password;
    private String nickname;
    private String openId;
    private String realName;
    private String phone;
    private String gender;
    private Integer status;
    private String lastLoginIp;
    private Integer superman;
    private Timestamp createdAt;
    private Integer createdByUserId;
    private String createdByRealName;

    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Id
    @Column(name = "user_id", nullable = false, insertable = true, updatable = true)
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "user_type", nullable = true, insertable = true, updatable = true)
    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    @Basic
    @Column(name = "email", nullable = true, insertable = true, updatable = true, length = 60)
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Basic
    @Column(name = "password", nullable = true, insertable = true, updatable = true, length = 32)
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Basic
    @Column(name = "nickname", nullable = true, insertable = true, updatable = true, length = 60)
    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    @Basic
    @Column(name = "open_id", nullable = true, insertable = true, updatable = true, length = 30)
    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    @Basic
    @Column(name = "real_name", nullable = true, insertable = true, updatable = true, length = 60)
    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    @Basic
    @Column(name = "phone", nullable = true, insertable = true, updatable = true, length = 20)
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Basic
    @Column(name = "gender", nullable = true, insertable = true, updatable = true, length = 20)
    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    @Basic
    @Column(name = "status", nullable = true, insertable = true, updatable = true)
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Basic
    @Column(name = "last_login_ip", nullable = true, insertable = true, updatable = true, length = 15)
    public String getLastLoginIp() {
        return lastLoginIp;
    }

    public void setLastLoginIp(String lastLoginIp) {
        this.lastLoginIp = lastLoginIp;
    }

    @Basic
    @Column(name = "superman", nullable = true, insertable = true, updatable = true)
    public Integer getSuperman() {
        return superman;
    }

    public void setSuperman(Integer superman) {
        this.superman = superman;
    }

    @Basic
    @Column(name = "created_at", nullable = true, insertable = true, updatable = true)
    public Timestamp getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Timestamp createdAt) {
        this.createdAt = createdAt;
    }

    @Basic
    @Column(name = "created_by_user_id", nullable = true, insertable = true, updatable = true)
    public Integer getCreatedByUserId() {
        return createdByUserId;
    }

    public void setCreatedByUserId(Integer createdByUserId) {
        this.createdByUserId = createdByUserId;
    }

    @Basic
    @Column(name = "created_by_real_name", nullable = true, insertable = true, updatable = true, length = 36)
    public String getCreatedByRealName() {
        return createdByRealName;
    }

    public void setCreatedByRealName(String createdByRealName) {
        this.createdByRealName = createdByRealName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        AdminUserEntity that = (AdminUserEntity) o;

        if (createdAt != null ? !createdAt.equals(that.createdAt) : that.createdAt != null) return false;
        if (createdByRealName != null ? !createdByRealName.equals(that.createdByRealName) : that.createdByRealName != null)
            return false;
        if (createdByUserId != null ? !createdByUserId.equals(that.createdByUserId) : that.createdByUserId != null)
            return false;
        if (email != null ? !email.equals(that.email) : that.email != null) return false;
        if (gender != null ? !gender.equals(that.gender) : that.gender != null) return false;
        if (lastLoginIp != null ? !lastLoginIp.equals(that.lastLoginIp) : that.lastLoginIp != null) return false;
        if (nickname != null ? !nickname.equals(that.nickname) : that.nickname != null) return false;
        if (openId != null ? !openId.equals(that.openId) : that.openId != null) return false;
        if (password != null ? !password.equals(that.password) : that.password != null) return false;
        if (phone != null ? !phone.equals(that.phone) : that.phone != null) return false;
        if (realName != null ? !realName.equals(that.realName) : that.realName != null) return false;
        if (status != null ? !status.equals(that.status) : that.status != null) return false;
        if (superman != null ? !superman.equals(that.superman) : that.superman != null) return false;
        if (userId != null ? !userId.equals(that.userId) : that.userId != null) return false;
        if (userType != null ? !userType.equals(that.userType) : that.userType != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = userId != null ? userId.hashCode() : 0;
        result = 31 * result + (userType != null ? userType.hashCode() : 0);
        result = 31 * result + (email != null ? email.hashCode() : 0);
        result = 31 * result + (password != null ? password.hashCode() : 0);
        result = 31 * result + (nickname != null ? nickname.hashCode() : 0);
        result = 31 * result + (openId != null ? openId.hashCode() : 0);
        result = 31 * result + (realName != null ? realName.hashCode() : 0);
        result = 31 * result + (phone != null ? phone.hashCode() : 0);
        result = 31 * result + (gender != null ? gender.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        result = 31 * result + (lastLoginIp != null ? lastLoginIp.hashCode() : 0);
        result = 31 * result + (superman != null ? superman.hashCode() : 0);
        result = 31 * result + (createdAt != null ? createdAt.hashCode() : 0);
        result = 31 * result + (createdByUserId != null ? createdByUserId.hashCode() : 0);
        result = 31 * result + (createdByRealName != null ? createdByRealName.hashCode() : 0);
        return result;
    }
}
